<?php echo $html->css('report'); ?>
<script type="text/javascript" language="javascript">
    jQuery(document).ready(function(){
        jQuery('input[type=submit]').click(function(){
        
            var currentBut;
			var act;
            switch (jQuery(this).attr('id')) {
				case 'messageButId':
                    currentBut = 'MessagesPerSchool';
                    act = whatAction(currentBut);
                    break;
					
                case 'schoolButId':
                    currentBut = 'School';
                    act = whatAction(currentBut);
                    break;
                case 'sponsorButId':
                    currentBut = 'Sponsor';
					act = whatAction(currentBut);
                    break;
                case 'subscriberButId':
                	currentBut = 'Subscriber';
 					act = whatAction(currentBut);
                    break;
            }
			jQuery('form').attr('action', act);
        });
    });
    var contextPath = '<?php echo $this->webroot?>';
    function whatAction(but){
        var action;
        switch ((jQuery('input[name=group1]:checked').attr('id'))) {
            case 'scrRad':
                action = 'reports/view'+but+'Html';
                break;
            case 'pdfRad':
                action = 'reports/view'+but+'Pdf';
                break;
            case 'csvRad':
                action = 'reports/view'+but+'Csv';
				break;
        }
		return contextPath+action;
    }
</script>
<div id="container" class="clearfix">
<?php echo $form->create('Report', array('controller' => 'reports', 'action' => 'index')); ?>
<div id="main_report" class="clearfix">
    <div class="title">
        SELECT DATES TO GENERATE REPORTS
    </div>
    <table border="0" cellpadding="0" cellspacing="0" width="785">
        <tr>
            <td width="40%">
                <div class="date">
                    <b>Start Date</b>
                    <input type="text" class="text" value="1/1/2010" size="20" disabled="disabled"/>
                </div>
                <div class="date">
                    <b>End Date</b>
                    <input type="text" class="text" value="1/1/2010" size="20" disabled="disabled"/>
                </div>
            </td>
            <td width="30%">
                <div class="box">
                    <div class="name">
                        Output to :
                    </div>
                    <div style="width:100%; float:left; text-align:left;">
                        <input id="scrRad" type="radio" name="group1" value="Screen">Screen
                        <br>
                        <input id="csvRad" type="radio" name="group1" value="CSV File">CSV File
                        <br>
                        <input id="pdfRad" type="radio" name="group1" value="PDF" checked>PDF
                    </div>
                </div>
            </td>
            <td width="30%">
                <input id="messageButId" type="submit" value="# Message Sent Per School" class="submit" style="width: 200px">
                <br>
                <input id="schoolButId" class="submit" type="submit" value="School List" class="submit" style="width: 200px">
                <br>
                <input id="sponsorButId" class="submit" type="submit" value="Sponsor List" class="submit" style="width: 200px">
                <br>
                <input id="subscriberButId" class="submit" type="submit" value="Subscriber List" class="submit" style="width:200px">
            </td>
        </tr>
    </table>
</div>
<?php echo $form->end();?>
</div>
